#!/bin/bash 
# creating and using a temp file
# 
tempfile=$(mktemp test19.XXX)

exec 3>$tempfile
echo "This script writes to temp file $tempfile"

echo "test line one" >&3
echo "test line two" >&3
echo "test line three" >&3

exec 3>&-

echo "Done creating temp file. The contents are:"
cat $tempfile
rm -f $tempfile 2> /dev/null

